<template>
  <el-button plain type="primary" size="mini" @click.stop="edit">编辑</el-button>
  <el-button plain size="mini" @click.stop="copy">复制</el-button>
  <el-button plain type="danger" size="mini" @click.stop="deleteQ">删除</el-button>
  <el-button plain size="mini" @click.stop="moveup">上移</el-button>
  <el-button plain size="mini" @click.stop="movedown">下移</el-button>
  <el-button plain size="mini" @click.stop="movetop">最前</el-button>
  <el-button plain size="mini" @click.stop="movebottom">最后</el-button>
  <relation :questionnaire-id="questionnaireId" :question-id="questionId" :type="type" :questions="questions" :question="question"></relation>
</template>

<script>
import relation from '../../question/relation.vue'

export default {
  name:'QuestionPosEdit',
  data(){
   return {

   }
  },
  components: {
    relation
  },

  props:{
    questionnaireId: Number,
    questionId: Number,
    type: String,
    questions: Array,
    question: Object,
  },
  emits: ['edit', 'copy', 'deleteQ', 'moveup', 'movedown', 'movetop', 'movebottom'],
  methods: {
    edit() {
      this.$emit('edit')
    },

    copy() {
      this.$emit('copy')
    },

    deleteQ() {
      this.$emit('deleteQ')
    },

    moveup() {
      this.$emit('moveup')
    },

    movedown() {
      this.$emit('movedown')
    },

    movetop() {
      this.$emit('movetop')
    },

    movebottom() {
      this.$emit('movebottom')
    },
  }
}
</script>

<style scoped>
  .el-button {
    float: right;
  }
</style>
